package TOOL;

import android.content.Context;
import android.content.SharedPreferences;

public class SaveTool {
    public Context mContext;
    public SharedPreferences setting;

    public SaveTool(Context context, String name)
    {
        mContext = context;
        setting = mContext.getSharedPreferences(name, 0);
    }

    public void putString(String name, String s)
    {
        SharedPreferences.Editor se = setting.edit();
        se.putString(name,s);
        se.commit();
    }

    public void putInt(String name, int i)
    {
        SharedPreferences.Editor se = setting.edit();
        se.putInt(name,i);
        se.commit();
    }

    public void putBoolean(String name, Boolean b)
    {
        SharedPreferences.Editor se = setting.edit();
        se.putBoolean(name,b);
        se.commit();
    }

    public String getString(String name, String n)
    {
        return setting.getString(name,  n);
    }


    public int getInt(String name, int i)
    {
        return setting.getInt(name, i);
    }

    public boolean getBoolean(String name, Boolean b)
    {
        return setting.getBoolean(name, b);
    }
}
